package io.renren.modules.jxgk.service.impl;

import io.renren.modules.jxgk.dao.TeacherInfoDao;
import io.renren.modules.jxgk.entity.TeacherInfoEntity;
import io.renren.modules.jxgk.service.TeacherInfoService;
import io.renren.modules.jxgkphone.entity.TeacherInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class TeacherInfoServiceImpl implements TeacherInfoService{
    @Autowired
    TeacherInfoDao teacherInfoDao;
    public List<TeacherInfoEntity> queryList(Map<String, Object> map){
        return teacherInfoDao.queryList(map);
    }
    public int queryTotal(Map<String, Object> map){
        return  teacherInfoDao.queryTotal(map);
    }
    public void deleteBatch(String[] termIds){
        teacherInfoDao.deleteBatch(termIds);
    }
    public void save(TeacherInfoEntity ste){
        teacherInfoDao.save(ste);
    }
    public TeacherInfoEntity queryObject(String index){
        return teacherInfoDao.queryObject(index);
    }
    public void update(TeacherInfoEntity ste){
        teacherInfoDao.update(ste);
    }

    @Override
    public String getCollegeByUsername(String username) {
        return teacherInfoDao.getCollegeByUsername(username);
    }

    @Override
    public List<TeacherInfo> getTecahersByCollegeUserName(String username) {
        String college=teacherInfoDao.getCollegeByUsername(username);
        Map<String,Object> map=new HashMap<>();
        map.put("college",college);
        return teacherInfoDao.getTeacherByCollege(map);
    }

    @Override
    public TeacherInfoEntity getTeacherInfo(String username) {
        return teacherInfoDao.getTeacherInfo(username);
    }
}
